home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / CUGUK / C048.ZIP / ALISP.ZIP / LISP.H < prev    next >
Text File  |  1985-08-06  |  2KB  |  110 lines

  1. #define FALSE    0
  2. #define TRUE    1
  3.  
  4. /* input types */
  5.  
  6. #define INQUOTE 1
  7. #define LPAREN    2
  8. #define RPAREN    3
  9. #define LETTER    4
  10. #define DIGIT    5
  11.  
  12.  
  13. /* token types */
  14.  
  15. #define IATOM    6
  16. #define RATOM    7
  17. #define SATOM    8
  18. #define FUNC    9
  19. #define LST    10
  20. #define VARI    11
  21. #define QUOTE    12
  22. #define NILL    13
  23. #define T    14
  24. #define COND    15
  25. #define DEFUN    16
  26. #define FCAR    17
  27. #define FCDR    18
  28. #define FCONS    19
  29. #define FEQ    20
  30. #define FATOM    21
  31. #define FQUOTE    22
  32. #define FSETQ    23
  33. #define FUSER    24
  34. #define PLUS    25
  35. #define DIFF    26
  36. #define TIMES    27
  37. #define QUOTIENT 28
  38. #define ADD1    29
  39. #define SUB1    30
  40. #define ZEROP    31
  41. #define NUMBERP 32
  42. #define GREATERP 33
  43. #define LESSP    34
  44. #define PRINT    35
  45. #define NUL    36
  46. #define FUNCALL 37
  47. #define PROG    38
  48. #define GO    39
  49. #define RETRN    40
  50. #define LABL    41
  51. #define FREAD    42
  52. #define FREPLACA 43
  53. #define FREPLACD 44
  54. #define FEVAL    45
  55. #define FAPPLY    46
  56.  
  57.  
  58. /* for garbage collection */
  59.  
  60. #define GARBAGE 47
  61. #define USED    48
  62. #define RUNNING 49
  63.  
  64.  
  65. /* more primitives */
  66.  
  67. #define FAND    50
  68. #define FOR    51
  69. #define FNOT    52
  70. #define FLIST    53
  71.  
  72. #define ERR    -1
  73.  
  74. typedef struct LIST {
  75.   char  gcbit;
  76.   char  htype;
  77.   union {
  78.     float num;
  79.     char  *pname;
  80.   } u;
  81.   struct LIST  *left;
  82.   struct LIST  *right;
  83. } LIST;
  84.  
  85. LIST *init();
  86. LIST *install();
  87. LIST *makelist();
  88. LIST *eval();
  89. LIST *evalcond();
  90. LIST *evalprog();
  91. LIST *pairargs();
  92. LIST *evalargs();
  93. LIST *assoc();
  94. LIST *getvar();
  95. LIST *arith();
  96. LIST *lookup();
  97. LIST *getnum();
  98. LIST *getid();
  99. LIST *new();
  100. LIST *car();
  101. LIST *cdr();
  102. LIST *cons();
  103. LIST *eq();
  104. LIST *atom();
  105. LIST *_and();
  106. LIST *_or();
  107. LIST *_not();
  108. LIST *_list();
  109.  
  110.